<?php
namespace app\index\controller;

use app\common\controller\IndexBase;

class Page extends IndexBase
{
    public function index()
    {
        return $this->fetch('../index');
    }
	public function about(){
		return $this->fetch('about1');
	}
	public function tech(){
		return $this->fetch('tech');
	}
	public function social(){
		return $this->fetch('social');
	}
	public function brand(){
		return $this->fetch('brand');
	}
	public function contact(){
		return $this->fetch('contact');
	}
	public function news(){
		return $this->fetch('news');
	}
	public function product(){
		return $this->fetch('product');
	}
    
    /**
     * 空方法 ,自适应
     * @param unknown $action
     * @return mixed|string
     */
    public function _empty($action)
    {
        if (!preg_match('/^[\w]+$/i', $action)) {
            $this->error('方法名有误!');
        }
        $id = input('id');
        $id && $this->assign('id',intval($id));
        return $this->fetch();
    }
    
    public function test($page=1){
        /*
        set_time_limit(0);
        $ck = 0;
        $page || $page=1;
        $rows = 200;
        $min = ($page-1)*$rows;
        $array = query("SELECT id,picurl FROM qb_cms_content1 order by id asc limit $min,$rows ");
        foreach($array AS $rs){
            if(preg_match('/^article/', $rs['picurl'])){
                
                $pic = 'uploads/'.$rs['picurl'];
                $s .= $pic.'<br>';
                query("UPDATE qb_cms_content1 SET picurl='$pic' WHERE id='{$rs[id]}' ");
            }
            $ck++;
        }
        if(empty($ck)){
            die('转换结束');
        }
        echo $s;
        $page++;
        echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=/index.php/index/index/test.html?page=$page'>";
        exit;*/
    }
    

    
}

